package test;

public class Homework5 {
    public static void main(String[] args) {
        String str = "D:\\myfile\\hello.java";
        String[] arr = str.split("\\\\");
        System.out.println(arr[2]);
        String[] arr1 = arr[2].split("[.]");
        System.out.println(".".concat(arr1[1]));

//        for (String s :arr1){
//            System.out.println(s);
//        }
//        String fileName = arr[arr.length];
//        String file = ".";
//        System.out.println(file.concat(fileName));
    }
}
